import { API_CONFIG } from "../config/index.js";
import request from './index.js'

export const getUserListHandler=()=>{
    return request(API_CONFIG.getUserListApi, {},"get","2000")
}

export const deleteUserHandler=(id)=>{
    console.log("删除用户:",id)
    return request(API_CONFIG.deleteUserApi, {id},"get","1000")
}

export const addUserHandler=(userForm)=>{
    console.log("添加用户:",userForm)
    return request(API_CONFIG.addUserApi, userForm,"post","1000")
}

export const updateUserHandler=(userForm)=>{
    console.log("更新用户:",userForm)
    return request(API_CONFIG.updateUserApi, userForm,"post","1000")
}

export const logoutHandler=()=>{
    return request(API_CONFIG.logoutApi,{},"get","2000")
}